import { defineStore } from "pinia";

type User = {
  name: String;
  age: Number;
};

let Login = (): Promise<User> => {
  return new Promise((resolve) => {
    resolve({
      name: "测试异步请求",
      age: 99,
    });
  });
};

export const TestGP = defineStore("Godz", {
  state: () => {
    return {
      current: 1,
      name: "Godz的pinia",
      user:<User>{},
    };
  },
  //computed 修饰一些值
  getters: {},
  //methods 可以做到同步 异步都可以做 提交state  函数
  actions: {
    cesboluo() {
      
    },
    setUser() {
      
    },
    async yibuUser() {
        
    },
  },
});
